Integrand size = 23, antiderivative size = 143 \[ \int (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\frac {(A-i B) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-i b}\right ) (a+b \tan (c+d x))^{1+n}}{2 (i a+b) d (1+n)}+\frac {(i A-B) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+i b}\right ) (a+b \tan (c+d x))^{1+n}}{2 (a+i b) d (1+n)} \]
1/2*(A-I*B)*hypergeom([1, 1+n],[2+n],(a+b*tan(d*x+c))/(a-I*b))*(a+b*tan(d* x+c))^(1+n)/(I*a+b)/d/(1+n)+1/2*(I*A-B)*hypergeom([1, 1+n],[2+n],(a+b*tan( d*x+c))/(a+I*b))*(a+b*tan(d*x+c))^(1+n)/(a+I*b)/d/(1+n)
Time = 0.20 (sec) , antiderivative size = 120, normalized size of antiderivative = 0.84 \[ \int (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\frac {i \left (-\frac {(A-i B) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a-i b}\right )}{a-i b}+\frac {(A+i B) \operatorname {Hypergeometric2F1}\left (1,1+n,2+n,\frac {a+b \tan (c+d x)}{a+i b}\right )}{a+i b}\right ) (a+b \tan (c+d x))^{1+n}}{2 d (1+n)} \]
((I/2)*(-(((A - I*B)*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x ])/(a - I*b)])/(a - I*b)) + ((A + I*B)*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x])/(a + I*b)])/(a + I*b))*(a + b*Tan[c + d*x])^(1 + n))/ (d*(1 + n))
Time = 0.38 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.01, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 4022, 3042, 4020, 25, 78}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (A+B \tan (c+d x)) (a+b \tan (c+d x))^n \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (A+B \tan (c+d x)) (a+b \tan (c+d x))^ndx\) |
\(\Big \downarrow \) 4022 |
\(\displaystyle \frac {1}{2} (A+i B) \int (1-i \tan (c+d x)) (a+b \tan (c+d x))^ndx+\frac {1}{2} (A-i B) \int (i \tan (c+d x)+1) (a+b \tan (c+d x))^ndx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{2} (A+i B) \int (1-i \tan (c+d x)) (a+b \tan (c+d x))^ndx+\frac {1}{2} (A-i B) \int (i \tan (c+d x)+1) (a+b \tan (c+d x))^ndx\) |
\(\Big \downarrow \) 4020 |
\(\displaystyle \frac {i (A-i B) \int -\frac {(a+b \tan (c+d x))^n}{1-i \tan (c+d x)}d(i \tan (c+d x))}{2 d}-\frac {i (A+i B) \int -\frac {(a+b \tan (c+d x))^n}{i \tan (c+d x)+1}d(-i \tan (c+d x))}{2 d}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {i (A+i B) \int \frac {(a+b \tan (c+d x))^n}{i \tan (c+d x)+1}d(-i \tan (c+d x))}{2 d}-\frac {i (A-i B) \int \frac {(a+b \tan (c+d x))^n}{1-i \tan (c+d x)}d(i \tan (c+d x))}{2 d}\) |
\(\Big \downarrow \) 78 |
\(\displaystyle \frac {i (A+i B) (a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a+i b}\right )}{2 d (n+1) (a+i b)}-\frac {i (A-i B) (a+b \tan (c+d x))^{n+1} \operatorname {Hypergeometric2F1}\left (1,n+1,n+2,\frac {a+b \tan (c+d x)}{a-i b}\right )}{2 d (n+1) (a-i b)}\) |
((-1/2*I)*(A - I*B)*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x] )/(a - I*b)]*(a + b*Tan[c + d*x])^(1 + n))/((a - I*b)*d*(1 + n)) + ((I/2)* (A + I*B)*Hypergeometric2F1[1, 1 + n, 2 + n, (a + b*Tan[c + d*x])/(a + I*b )]*(a + b*Tan[c + d*x])^(1 + n))/((a + I*b)*d*(1 + n))
3.5.98.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(b *c - a*d)^n*((a + b*x)^(m + 1)/(b^(n + 1)*(m + 1)))*Hypergeometric2F1[-n, m + 1, m + 2, (-d)*((a + b*x)/(b*c - a*d))], x] /; FreeQ[{a, b, c, d, m}, x] && !IntegerQ[m] && IntegerQ[n]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[c*(d/f) Subst[Int[(a + (b/d)*x)^m/(d^2 + c*x), x], x, d*Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[ b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && EqQ[c^2 + d^2, 0]
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c + I*d)/2 Int[(a + b*Tan[e + f*x])^m*( 1 - I*Tan[e + f*x]), x], x] + Simp[(c - I*d)/2 Int[(a + b*Tan[e + f*x])^m *(1 + I*Tan[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && !IntegerQ[m]
\[\int \left (a +b \tan \left (d x +c \right )\right )^{n} \left (A +B \tan \left (d x +c \right )\right )d x\]
\[ \int (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \,d x } \]
\[ \int (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int \left (A + B \tan {\left (c + d x \right )}\right ) \left (a + b \tan {\left (c + d x \right )}\right )^{n}\, dx \]
\[ \int (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \,d x } \]
\[ \int (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int { {\left (B \tan \left (d x + c\right ) + A\right )} {\left (b \tan \left (d x + c\right ) + a\right )}^{n} \,d x } \]
Timed out. \[ \int (a+b \tan (c+d x))^n (A+B \tan (c+d x)) \, dx=\int \left (A+B\,\mathrm {tan}\left (c+d\,x\right )\right )\,{\left (a+b\,\mathrm {tan}\left (c+d\,x\right )\right )}^n \,d x \]